package com.cmc.cloud.cmclink.doc.api.document.rep;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 订舱相关方信息 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
public class SoScnBaseDto {

    @Schema(description = "外键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10990")
    private Long soId;

    @Schema(description = "相关方类型 shipper、consignee、notify、notify2、booking_contact、dg_contact", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 10, message = "相关方类型支持最大长度{max}")
    private String partyTypeCode;

    @Schema(description = "公司客商主数据代码")
    @Length(max = 50, message = "公司客商主数据代码支持最大长度{max}")
    private String csmCode;

    @Schema(description = "企业唯一识别码 前缀 USCI")
    @Length(max = 50, message = "企业唯一识别码前缀支持最大长度{max}")
    private String uniqueIdentifierPre;

    @Schema(description = "企业唯一识别码 后缀 12345678")
    @Length(max = 50, message = "企业唯一识别码后缀支持最大长度{max}")
    private String uniqueIdentifierFix;

    @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @NotBlank(message = "公司名称不能为空")
    @Length(max = 500, message = "公司名称支持最大长度{max}")
    private String companyName;

    @Schema(description = "公司地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "公司地址不能为空")
    @Length(max = 500, message = "公司地址支持最大长度{max}")
    private String companyAddress;

    @Schema(description = "国家代码")
    @Length(max = 2, message = "国家代码支持最大长度{max}")
    private String countryCode;

    @Schema(description = "电话")
    @Length(max = 50, message = "电话支持最大长度{max}")
    private String telephone;

    @Schema(description = "邮箱")
    @Length(max = 50, message = "邮箱支持最大长度{max}")
    private String email;

    @Schema(description = "传真")
    @Length(max = 50, message = "传真支持最大长度{max}")
    private String fax;

    @Schema(description = "城市")
    @Length(max = 50, message = "城市支持最大长度{max}")
    private String city;

    @Schema(description = "省份")
    @Length(max = 50, message = "省份支持最大长度{max}")
    private String province;

    @Schema(description = "AEO")
    @Length(max = 50, message = "AEO支持最大长度{max}")
    private String aeo;

    @Schema(description = "邮政编码")
    @Length(max = 50, message = "邮政编码支持最大长度{max}")
    private String zipCode;


//    public static CompareUtils<SoScnBaseVO> getMultiFieldComparator() {
//        return new CompareUtils<SoScnBaseVO>().comparingField(SoScnBaseVO::getPartyTypeCode)
//                .thenComparing(SoScnBaseVO::getCsmCode)
//                .thenComparing(SoScnBaseVO::getUniqueIdentifierPre)
//                .thenComparing(SoScnBaseVO::getUniqueIdentifierFix)
//                .thenComparing(SoScnBaseVO::getCompanyName)
//                .thenComparing(SoScnBaseVO::getCountryCode)
//                .thenComparing(SoScnBaseVO::getTelephone)
//                .thenComparing(SoScnBaseVO::getEmail)
//                .thenComparing(SoScnBaseVO::getFax)
//                .thenComparing(SoScnBaseVO::getCity)
//                .thenComparing(SoScnBaseVO::getProvince)
//                .thenComparing(SoScnBaseVO::getAeo)
//                .thenComparing(SoScnBaseVO::getZipCode);
//    }

}
